package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

@Mapper
public interface UserMapper {
    /**
     *判断当前用户是否为新用户
     */
    User getByOpenid(String openid);

    /**
     *新增用户,要返回id值
     */
    void insert(User user);

    /**
     * 获取当前登录的用户信息
     */
    @Select("select * from user where id = #{userId}")
    User getById(Long userId);

    /**
     * 用户统计
     */
    Integer countByMap(Map map);
}
